﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.Text;
using System.Threading.Tasks;

namespace rmTest.Common.ModelUtil
{
    public class ItemExtend : Dictionary<string, object>
    {
        public ItemExtend()
        {
        }

        public T GetItem<T>(string sKey)
        {
            return (T)base[sKey];
        }

        public T GetItem<T>(string sKey, T defaultT)
        {
            if (base.ContainsKey(sKey))
            {
                return (T)base[sKey];
            }
            return defaultT;
        }

        protected ItemExtend(SerializationInfo info, StreamingContext context)
            : base(info, context)
        {
        }

        public override void GetObjectData(SerializationInfo info, StreamingContext context)
        {
            base.GetObjectData(info, context);
        }
    }

}
